cmake_minimum_required(VERSION 3.10)

project(test_config)

# 第三方库头文件路径
set(BOOST_INCLUDE_DIR /opt/homebrew/Cellar/boost/1.84.0_1/include)
set(YAML_INCLUDE_DIR /usr/local/include)

# 第三方库库文件路径
set(YAML_LIB_DIR /usr/local/lib/)

# canon库路径
set(CANON_LIB_PATH ${ROOT_PATH}/lib)

find_package(yaml-cpp REQUIRED)

include_directories(
        ${BOOST_INCLUDE_DIR}
        ${YAML_INCLUDE_DIR}
)

link_directories(
        ${CANON_LIB_PATH}
)

add_executable(${PROJECT_NAME} main.cpp)

target_link_libraries(${PROJECT_NAME} PUBLIC
        yaml-cpp        
        canon
)

SET(EXECUTABLE_OUTPUT_PATH ${ROOT_PATH}/bin)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
        COMMAND mkdir -p ${ROOT_PATH}/bin/config
)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
        COMMAND cp -r ${CMAKE_CURRENT_LIST_DIR}/config/* ${ROOT_PATH}/bin/config
)